package org.example.config;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

public class MapperConfig {

    public SqlSessionFactory useMapper(String configPath) throws IOException {
        InputStream resource = Resources.getResourceAsStream(configPath);
        return new SqlSessionFactoryBuilder().build(resource);
    }
}
